/********************************************/
  // Creation History
  // --------------------------------------------------------------
  //	Company:			HTHK
  //	NAME:				GroupOptions.java
  //    Title   :			Make the Group coming into being a list box
  //	FUNCTION:
  //	BY:				Poly Li
  //	DATE:				14/01/2004
  // --------------------------------------------------------------
/*********************************************/

package tss.options;

import tss.common.Options2;
import java.util.ArrayList;
import java.sql.Connection;
import tss.group.*;

/**
 * A Class class.
 * <P>
 * @author HTHK
 */
public class GroupOptions
  extends Options2
{

  /**
   * Constructor
   */
	public GroupOptions()
	{
		this.load();
	}

	//protected ArrayList createOptions(Connection con)
	@Override
	public ArrayList createOptions(Connection con)
		throws Exception
	{
		ArrayList options = new ArrayList();
		GroupBean group = GroupProcess.createBean();
		group.setGroup_name("");
		GroupBean[] groups = GroupProcess.find(con,group);
		for (int i=0; i<groups.length; i++)
		{
		       Options2.Option option
		        = new Options2.Option( groups[i].getGroup_name(),
		                              groups[i].getGroup_name());
		        options.add(i,option);
		}
		return options;
	}
}

